home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / gutil / ztack.c < prev   
Encoding:
C/C++ Source or Header  |  1985-02-08  |  563 b   |  33 lines

  1. # include    <sccs.h>
  2. # include    <useful.h>
  3.  
  4. SCCSID(@(#)ztack.c    8.2    2/8/85)
  5.  
  6. /*
  7. **  LOCAL STRING CONCATENATE
  8. **    Strings `a' and `b' are concatenated and left in an
  9. **    internal buffer.  A pointer to that buffer is returned.
  10. **
  11. **    Ztack can be called recursively as:
  12. **        ztack(ztack(ztack(w, x), y), z);
  13. */
  14.  
  15. char *
  16. ztack(a, b)
  17. register char    *a, *b;
  18. {
  19.     register char    *c;
  20.     static char    buf[CONCAT_BUFSZ];
  21.     
  22.     c = buf;
  23.     
  24.     while (*a)
  25.         *c++ = *a++;
  26.     while (*b)
  27.         *c++ = *b++;
  28.     *c = '\0';
  29.     if (buf[CONCAT_BUFSZ - 1] != 0)
  30.         syserr("ztack overflow: %s", buf);
  31.     return (buf);
  32. }
  33.